//
//  PhotoViewController.h
//  FunOCR
//
//  Created by Luke Du on 10/03/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ServiceProtocol.h"

@class FunOCRAppDelegate;

@class GDataEntryDocBase;

@class GDataServiceGoogle;


@interface PhotoViewController : UIViewController<ServiceProtocol> {
	
	UIImage *image;
    UIImage *rotatedImage;
	UIImageView *ivPhotoView; 
	UIButton *btnRetakePhoto; 
	UIButton *btnRotate;
	
	UIBarButtonItem *bbiBack;
	UIBarButtonItem *bbiSend;
	
	UIActivityIndicatorView *spinner;
	
	float angle;
	
	FunOCRAppDelegate *appDelegate;
	
}
@property (nonatomic, retain) UIImage *image;

@property (nonatomic, retain) IBOutlet UIImageView *ivPhotoView;  
@property (nonatomic, retain) IBOutlet UIButton *btnRetakePhoto; 
@property (nonatomic, retain) IBOutlet UIButton *btnRotate;
@property (nonatomic, retain) IBOutlet UIBarButtonItem *bbiBack;
@property (nonatomic, retain) IBOutlet UIBarButtonItem *bbiSend;
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *spinner;


- (IBAction)rotateImage:(id)sender; 

- (IBAction)backClicked:(id)sender;

- (IBAction)sendClicked:(id)sender;


-(void)ocrAction;

- (UIImage *) grayscaleImage: (UIImage *) givenImage;

- (void)saveDocEntry:(GDataEntryDocBase *)entry exportFormat:(NSString *)exportFormat authService:(GDataServiceGoogle *)service;

@end
